<template>
  <div class="siteDetail">
    <zyInfoPanel title="基本信息" :showUnfoldButton="false" class="sitePanelItem">
      <zyInfoPanelDetail :info="baseInfo" cellNum="4"></zyInfoPanelDetail>
    </zyInfoPanel>
    <zyInfoPanel title="附件" :showUnfoldButton="false" class="sitePanelItem">
      <div class="imgArea">
        <div class="imgTitle">营业执照（副本）：</div>
        <div class="imgContent">
          <zy-image v-model="license_img" class="img" readonly></zy-image>
        </div>
      </div>
    </zyInfoPanel>
  </div>
</template>

<script>
	export default {
		name: "SSiteDetail",
		props: {},
		data() {
			return {
				cooperid: '',
				baseInfo: [
					{
						name: "站点名称：",
						val: "",
						code: 'company_name'
					},
					{
						name: "站点地址：",
						val: "",
						code: 'company_address'
					},
					{
						name: "法人姓名：",
						val: "",
						code: 'legal_person'
					},
					{
						name: "法人联系方式：",
						val: "",
						code: 'legal_phone'
					},
					{
						name: "统一社会信用代码：",
						val: "",
						code: 'organization_code'
					},
					{
						name: "负责人：",
						val: "",
						code: 'control_man'
					},
					{
						name: "联系方式：",
						val: "",
						code: 'control_phone'
					},
        ],
				license_img: ''
      };
		},
		computed: {},
		watch: {},
		components: {},
		methods: {
			getData(){
				this.$axios.post(this.$api.cooperDetail, {
					company_id: this.cooperid
				}).then(res => {
					let {code, msg, data} = res;
					this.loading = false;
					if (code == 200) {
						this.baseInfo = this.baseInfo.filter(item=>{
							item.val = data[item.code];
							return item
						});
						this.license_img = data.license_img
					} else {
						this.$message.error(msg);
					}
				}).catch(ret => {
					this.$message.error(ret.msg || '服务繁忙，请稍后再试');
				});
			},
    },
		mounted() {
			this.cooperid = this.$route.query.cooperid;
			this.getData()
		},
		created() {
		}
	}
</script>

<style scoped lang="less" src="@/style/sorting/cooperativeSite/siteDetail/index.less">

</style>
